﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Reporting.WinForms;

namespace Billing.Reports
{
    public partial class SimpleReportForm : Billing.WindowsBase.ReportFormBase
    {
        public SimpleReportForm()
            : this(null)
        {

        }

        public SimpleReportForm(string reportName)
            : this(reportName, ProcessingMode.Remote)
        {

        }

        public SimpleReportForm(string reportName, ProcessingMode processingMode)
            : base(reportName, processingMode)
        {
            InitializeComponent();
            this.reportViewer.ReportRefresh += new CancelEventHandler(reportViewer_ReportRefresh);
            this.reportViewer.Print += new CancelEventHandler(reportViewer_Print);
            this.reportViewer.RenderingComplete += new Microsoft.Reporting.WinForms.RenderingCompleteEventHandler(reportViewer_RenderingComplete);
            this.reportViewer.RenderingBegin += new CancelEventHandler(reportViewer_RenderingBegin);
            PrepareForSelectDialogStyle();
        }

        void reportViewer_RenderingBegin(object sender, CancelEventArgs e)
        {
            OnRenderingBegin(e);
        }

        void reportViewer_RenderingComplete(object sender, Microsoft.Reporting.WinForms.RenderingCompleteEventArgs e)
        {
            OnRenderingComplete(e);
        }

        void reportViewer_Print(object sender, CancelEventArgs e)
        {
            OnPrint(e);
        }

        void reportViewer_ReportRefresh(object sender, CancelEventArgs e)
        {
            OnReprotRefresh(e);
        }

        private void ReportForm_Load(object sender, EventArgs e)
        {

        }

        private void reportViewer1_ReportRefresh(object sender, CancelEventArgs e)
        {

        }

        protected override void OnLoadReport(EventArgs e)
        {
            ServerReport sr = this.reportViewer.ServerReport;
            base.OnLoadReport(e);
        }

        public override void RefreshReport()
        {
            this.reportViewer.RefreshReport();
            base.RefreshReport();
        }
    }
}
